/**
 * 炮塔
 */

module.exports = function () {
    for (let room in Game.rooms) {
        let towers = Game.rooms[room].find(FIND_STRUCTURES, {
            filter: structure => structure.structureType == STRUCTURE_TOWER
        });
        towers.forEach(tower => {
            if (tower.actionAttack() == 1) {
                if (tower.actionRepair() == 1) {
                    tower.actionHeal();
                }
            }
        });
    }
};